<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui">

	<h:head>
	     <title>在途信息</title>
	     <style type="text/css">
	         .ui-widget {
	             font-size: 90%;
	         }
	     </style>
	 </h:head>

<h:form>
	<h:panelGrid columns="2" cellpadding="5">

        <p:outputLabel for="id" value="id: " rendered="#{not empty transitForm.id}"/>
        <p:inputText id="id" value="#{transitForm.id}" rendered="#{not empty transitForm.id}" disabled="true"/>

        <p:outputLabel for="transitDate" value="在途日期: " />
		<p:calendar id="transitDate" value="#{transitForm.transitDate}" pattern="yyyy-MM-dd" />

        <p:outputLabel for="goodsTotalCount" value="总数量: " />
        <p:inputText id="goodsTotalCount" value="#{transitForm.goodsTotalCount}" size="5" />

        <p:outputLabel for="goodsTotalPrice" value="总金额: " />
        <p:inputText id="goodsTotalPrice" value="#{transitForm.goodsTotalPrice}" size="5" />

        <p:outputLabel for="freightTotal" value="总运费: " />
        <p:inputText id="freightTotal" value="#{transitForm.freightTotal}" size="5" />

        <p:outputLabel for="arriveFlg" value="是否到货: " />
        <p:selectBooleanButton id="arriveFlg" value="#{transitForm.arriveFlg}" onLabel="Yes" offLabel="No" onIcon="ui-icon-check" offIcon="ui-icon-close" style="width:60px" />

        <p:outputLabel for="arriveDate" value="到货日期: " />
		<p:calendar id="arriveDate" value="#{transitForm.arriveDate}" pattern="yyyy-MM-dd" />

        <p:commandButton value="登录" actionListener="#{transitBean.registerTransit}" rendered="#{empty transitForm.id}">
        	<p:confirm header="Confirmation" message="Are you sure?" icon="ui-icon-alert" />
        </p:commandButton>
        <p:commandButton value="更新" actionListener="#{transitBean.updateTransit}" rendered="#{not empty transitForm.id}">
        	<p:confirm header="Confirmation" message="Are you sure?" icon="ui-icon-alert" />
        </p:commandButton>

    </h:panelGrid>

	<p:confirmDialog global="true" showEffect="fade" hideEffect="explode">
        <p:commandButton value="Yes" type="button" styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />
        <p:commandButton value="No" type="button" styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
    </p:confirmDialog>
</h:form>

</ui:composition>